<!doctype>
<html>
<head>
<script src='http://localhost/js/jquery-1.7.min.js'></script>
<script src="http://localhost/js/io-0.8.7.min.js"></script>
<script type="text/javascript">
var socket = null;

$(function() {
    $('#log').append('1' + '\n');
    socket = io.connect('http://fanghuanweiran.com:2200');
    $('#log').append('2' + '\n');
    socket.on('connect', function () {
        $('#log').append('connected' + '\n');
        socket.emit('setimei', '353419036592322');
        $('#log').append('emit: setimei 353419036592322' + '\n\n');
    });
    $('#log').append('3' + '\n');
    socket.on('disconnect', function () {
        $('#log').append('disconnected' + '\n'); 
    });
    $('#log').append('4' + '\n');
    socket.on('updatepvt', function (pvt) {
        var i = '', str = '';
        for ( i in pvt ) {
            str += 'pvt.' + i + ': ' + pvt[i] + '\n';
        }
        $('#log').append(str + '\n');
    });
    $('#log').append('5' + '\n');
    socket.on('updatepgg', function (pgg) {
        var i = '', str = '';
        for ( i in pgg ) {
            str += 'pgg.' + i + ': ' + pgg[i] + '\n';
        }
        $('#log').append(str + '\n');
    });
});
</script>
</head>
<body>
<pre id = 'log'>
</pre>
</body>
</html>

